﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace MIP_Projekt2011_bjarke
{
    class InputHandler
    {
        ConsoleKeyInfo ConsoleInfo;
        public void ReadKey()
        {
            ConsoleInfo = Console.ReadKey(true);
            if ((ConsoleInfo.Modifiers & ConsoleModifiers.Control) != 0)
            {
                switch (ConsoleInfo.Key)
                {
                    case ConsoleKey.B:
                        Program.mode = ConsoleUI.Mode.Books;
                        break;
                    case ConsoleKey.N:
                        Program.mode = ConsoleUI.Mode.NotBorrowed;
                        break;
                    case ConsoleKey.T:
                        Program.mode = ConsoleUI.Mode.Search;
                        break;
                    case ConsoleKey.F:
                        Program.mode = ConsoleUI.Mode.AutherSearch;
                        break;
                    case ConsoleKey.H:
                        Program.mode = ConsoleUI.Mode.Welcome;
                        break;
                    case ConsoleKey.L:
                        Program.mode = ConsoleUI.Mode.Lån;
                        break;

                    // Et case som kunne implementeres senere til at 
                    // oprette en ny bog i bibliotekssystemet.
                    //case ConsoleKey.P:
                    //    Program.mode = Library.Mode.CreateBook;
                    //    break;
                    case ConsoleKey.Q:
                        Program.run = false;
                        break;
                    default:
                        break;
                }
            }
        }   
    }
}
